cmake_minimum_required(VERSION 3.13)

# Pull in SDK (must be before project)
include(pico_sdk_import.cmake)

# Pull in FreeRTOS
include(FreeRTOS_Kernel_import.cmake)

project(example C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

pico_sdk_init()

# ------------------------------ cli with trace --------------------------------

add_executable(smp_cli
        main.c
        serial.c
        CLI-commands.c
        UARTCommandConsole.c
        ./FreeRTOS-Plus-CLI/FreeRTOS_CLI.c
        )

pico_generate_pio_header(smp_cli ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio OUTPUT_DIR ${CMAKE_CURRENT_LIST_DIR}/generated)

target_compile_definitions(smp_cli PRIVATE
        )

target_include_directories(smp_cli PRIVATE
        ${CMAKE_CURRENT_LIST_DIR}
        ${CMAKE_CURRENT_LIST_DIR}/../../Common/include
        ${CMAKE_CURRENT_LIST_DIR}/FreeRTOS-Plus-CLI)

target_link_libraries(smp_cli pico_multicore pico_stdlib hardware_pio FreeRTOS-Kernel FreeRTOS-Kernel-Heap4)

if (TARGET tinyusb_device)
	# enable usb output, disable uart output
	pico_enable_stdio_usb(smp_cli 1)
	pico_enable_stdio_uart(smp_cli 0)
elseif(PICO_ON_DEVICE)
    message(WARNING "not building hello_usb because TinyUSB submodule is not initialized in the SDK")
endif()

pico_add_extra_outputs(smp_cli)

# ------------------------------------------------------------------------------